<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>抢购中心 - 奢享时光</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
  <style>
    :root {
      --primary-gradient: linear-gradient(135deg, #7F00FF, #E100FF);
      --secondary-gradient: linear-gradient(135deg, #00F5A0, #00D9F5);
      --primary-color: #7F00FF;
      --secondary-color: #00F5A0;
      --accent-color: #FFE600;
      --danger-color: #FF4F6F;
      --dark-bg: #2D1B69;
      --light-bg: #6B3FA0;
      --text-light: #FFFFFF;
      --text-secondary: #E0D5FF;
      --card-bg: rgba(255, 255, 255, 0.1);
      --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
      --border-radius: 16px;
      --border: 1px solid rgba(255, 255, 255, 0.18);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      font-family: 'Noto Sans SC', 'Poppins', sans-serif;
      background: var(--dark-bg);
      color: var(--text-light);
      font-size: 14px;
      line-height: 1.5;
      overflow-x: hidden;
    }

    a {
      text-decoration: none;
      color: inherit;
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      outline: none;
    }

    .app-container {
      max-width: 480px;
      margin: 0 auto;
      min-height: 100vh;
      background: linear-gradient(180deg, var(--dark-bg), var(--light-bg));
      position: relative;
      overflow: hidden;
      padding-bottom: 70px;
    }

    /* 背景装饰 */
    .bg-decoration {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
    }

    .bg-circle {
      position: absolute;
      border-radius: 50%;
    }

    .bg-circle:nth-child(1) {
      width: 300px;
      height: 300px;
      top: -150px;
      right: -150px;
      background: radial-gradient(circle, rgba(225, 0, 255, 0.2), rgba(225, 0, 255, 0));
    }

    .bg-circle:nth-child(2) {
      width: 250px;
      height: 250px;
      bottom: 20%;
      left: -100px;
      background: radial-gradient(circle, rgba(0, 245, 160, 0.15), rgba(0, 245, 160, 0));
    }

    /* 顶部导航 */
    .header {
      position: sticky;
      top: 0;
      z-index: 100;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      background: rgba(45, 27, 105, 0.8);
      padding: 15px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: var(--border);
    }

    .back-button {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }

    .page-title {
      font-size: 18px;
      font-weight: 600;
    }

    .ticket-info {
      display: flex;
      align-items: center;
      gap: 5px;
      color: var(--accent-color);
      font-size: 14px;
    }

    .ticket-info i {
      font-size: 16px;
    }

    /* 内容区域 */
    .content {
      position: relative;
      z-index: 1;
      padding: 20px;
    }

    /* 倒计时区域 */
    .countdown-section {
      margin-bottom: 25px;
      text-align: center;
    }

    .countdown-title {
      font-size: 16px;
      margin-bottom: 15px;
      color: var(--text-secondary);
    }

    .countdown-ring {
      position: relative;
      width: 250px;
      height: 250px;
      margin: 0 auto 20px;
    }

    .ring-bg {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.05);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .ring-progress {
      position: absolute;
      top: 5px;
      left: 5px;
      width: calc(100% - 10px);
      height: calc(100% - 10px);
      border-radius: 50%;
      background: conic-gradient(
        var(--accent-color) 0%,
        var(--accent-color) 75%,
        transparent 75%,
        transparent 100%
      );
      clip-path: circle(50% at center);
      transform: rotate(-90deg);
    }

    .ring-inner {
      position: absolute;
      top: 20px;
      left: 20px;
      width: calc(100% - 40px);
      height: calc(100% - 40px);
      border-radius: 50%;
      background: linear-gradient(45deg, rgba(45, 27, 105, 0.9), rgba(107, 63, 160, 0.9));
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .time-display {
      font-size: 36px;
      font-weight: 700;
      margin-bottom: 5px;
      letter-spacing: 2px;
    }

    .time-label {
      font-size: 14px;
      color: var(--text-secondary);
    }

    /* 抢购信息 */
    .group-info {
      margin-bottom: 25px;
      position: relative;
    }

    .group-status {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: var(--border);
      border-radius: var(--border-radius);
      padding: 15px;
      margin-bottom: 15px;
      display: flex;
      justify-content: space-between;
      box-shadow: var(--shadow);
    }

    .status-box {
      flex: 1;
    }

    .status-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 5px;
    }

    .status-subtitle {
      font-size: 12px;
      color: var(--text-secondary);
    }

    .status-stats {
      display: flex;
      gap: 15px;
    }

    .stat-box {
      text-align: center;
    }

    .stat-value {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 2px;
      background: var(--secondary-gradient);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .stat-label {
      font-size: 12px;
      color: var(--text-secondary);
    }

    /* 抢购卡片 */
    .group-card {
      position: relative;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: var(--border);
      border-radius: var(--border-radius);
      overflow: hidden;
      margin-bottom: 15px;
      box-shadow: var(--shadow);
    }

    .card-status {
      position: absolute;
      top: 12px;
      left: 12px;
      padding: 4px 12px;
      border-radius: 100px;
      font-size: 12px;
      font-weight: 500;
      z-index: 2;
    }

    .status-urgent {
      background: var(--danger-color);
      color: white;
    }

    .status-active {
      background: var(--accent-color);
      color: var(--dark-bg);
    }

    .card-countdown {
      position: absolute;
      top: 12px;
      right: 12px;
      padding: 4px 12px;
      border-radius: 100px;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
      font-size: 12px;
      color: var(--text-light);
      z-index: 2;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .card-countdown i {
      color: var(--accent-color);
    }

    .group-image {
      height: 180px;
      width: 100%;
      position: relative;
    }

    .group-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .image-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(to bottom, rgba(45, 27, 105, 0), rgba(45, 27, 105, 0.8));
    }

    .group-content {
      padding: 15px;
    }

    .group-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 12px;
    }

    .group-price {
      display: flex;
      justify-content: space-between;
      margin-bottom: 15px;
    }

    .real-price {
      font-size: 13px;
      color: var(--text-secondary);
      text-decoration: line-through;
    }

    .sale-price {
      font-size: 16px;
      font-weight: 700;
      color: var(--accent-color);
    }

    .group-progress-bar {
      margin-bottom: 15px;
    }

    .progress-track {
      height: 8px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 100px;
      overflow: hidden;
      margin-bottom: 8px;
    }

    .progress-fill {
      height: 100%;
      background: var(--primary-gradient);
      border-radius: 100px;
      position: relative;
    }

    .progress-fill::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 20px;
      height: 100%;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
      animation: shimmer 1.5s infinite;
    }

    .progress-text {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text-secondary);
    }

    .joined {
      color: var(--text-light);
      font-weight: 500;
    }

    .join-group-btn {
      width: 100%;
      padding: 12px;
      border-radius: 100px;
      background: var(--primary-gradient);
      color: var(--text-light);
      font-size: 16px;
      font-weight: 600;
      text-align: center;
      box-shadow: 0 5px 15px rgba(127, 0, 255, 0.3);
      transition: all 0.3s ease;
    }

    .join-group-btn:active {
      transform: translateY(2px);
      box-shadow: 0 2px 8px rgba(127, 0, 255, 0.3);
    }

    /* 规则说明 */
    .rules-section {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: var(--border);
      border-radius: var(--border-radius);
      padding: 15px;
      margin-bottom: 25px;
      box-shadow: var(--shadow);
    }

    .rules-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 15px;
    }

    .rules-title {
      font-size: 16px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .rules-title i {
      color: var(--accent-color);
    }

    .rules-toggle {
      font-size: 13px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .rules-content {
      max-height: 500px;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }

    .rules-content.collapsed {
      max-height: 0;
    }

    .rule-item {
      display: flex;
      gap: 10px;
      margin-bottom: 12px;
    }

    .rule-item:last-child {
      margin-bottom: 0;
    }

    .rule-num {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 500;
      flex-shrink: 0;
    }

    .rule-text {
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    /* 底部导航 */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      max-width: 480px;
      margin: 0 auto;
      background: rgba(45, 27, 105, 0.8);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-top: var(--border);
      display: flex;
      justify-content: space-around;
      padding: 12px 0;
      z-index: 100;
    }

    .nav-button {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      color: var(--text-secondary);
      font-size: 12px;
      padding: 5px 0;
      flex: 1;
      transition: all 0.3s ease;
    }

    .nav-button i {
      font-size: 18px;
      margin-bottom: 2px;
    }

    .nav-button.active {
      color: var(--accent-color);
    }

    .middle-button {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: var(--primary-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      color: var(--text-light);
      box-shadow: 0 5px 15px rgba(127, 0, 255, 0.4);
      margin-top: -25px;
    }

    /* 动画 */
    @keyframes shimmer {
      0% { transform: translateX(-100%); }
      100% { transform: translateX(100%); }
    }

    @keyframes pulse {
      0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 230, 0, 0.7); }
      70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(255, 230, 0, 0); }
      100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 230, 0, 0); }
    }

    /* 响应式调整 */
    @media (max-width: 375px) {
      .countdown-ring {
        width: 220px;
        height: 220px;
      }

      .time-display {
        font-size: 32px;
      }

      .group-image {
        height: 160px;
      }
    }
  </style>
</head>
<body>
  <div class="app-container">
    <!-- 背景装饰 -->
    <div class="bg-decoration">
      <div class="bg-circle"></div>
      <div class="bg-circle"></div>
    </div>

    <!-- 顶部导航 -->
    <header class="header">
      <a href="index.html" class="back-button">
        <i class="fas fa-arrow-left"></i>
      </a>
      <div class="page-title">拼团抢购</div>
      <div class="ticket-info">
        <i class="fas fa-ticket-alt"></i>
        <span>3张券</span>
      </div>
    </header>

    <!-- 主要内容 -->
    <main class="content">
      <!-- 倒计时区域 -->
      <section class="countdown-section">
        <h2 class="countdown-title">本场拼团倒计时</h2>
        <div class="countdown-ring">
          <div class="ring-bg"></div>
          <div class="ring-progress"></div>
          <div class="ring-inner">
            <div class="time-display">01:45:30</div>
            <div class="time-label">距结束还剩</div>
          </div>
        </div>
      </section>

      <!-- 抢购信息 -->
      <section class="group-info">
        <div class="group-status">
          <div class="status-box">
            <div class="status-title">本场奢享抢购</div>
            <div class="status-subtitle">每日多个场次，错过不要遗憾</div>
          </div>
          <div class="status-stats">
            <div class="stat-box">
              <div class="stat-value">28</div>
              <div class="stat-label">进行中</div>
            </div>
            <div class="stat-box">
              <div class="stat-value">186</div>
              <div class="stat-label">今日成团</div>
            </div>
          </div>
        </div>

        <!-- 抢购卡片 -->
        <div class="group-card">
          <div class="card-status status-urgent">即将成团</div>
          <div class="card-countdown">
            <i class="fas fa-clock"></i>
            <span>27:50</span>
          </div>
          <div class="group-image">
            <img src="https://images.pexels.com/photos/190819/pexels-photo-190819.jpeg?auto=compress&cs=tinysrgb&w=800" alt="奢华手表">
            <div class="image-overlay"></div>
          </div>
          <div class="group-content">
            <h3 class="group-title">瑞士进口自动机械腕表</h3>
            <div class="group-price">
              <div class="real-price">市场价: ¥3980</div>
              <div class="sale-price">抢购价: ¥500</div>
            </div>
            <div class="group-progress-bar">
              <div class="progress-track">
                <div class="progress-fill" style="width: 80%;"></div>
              </div>
              <div class="progress-text">
                <span><span class="joined">8</span> / 10人</span>
                <span>即将成团</span>
              </div>
            </div>
            <button class="join-group-btn">立即加入拼团</button>
          </div>
        </div>

        <div class="group-card">
          <div class="card-status status-active">火热拼团</div>
          <div class="card-countdown">
            <i class="fas fa-clock"></i>
            <span>42:15</span>
          </div>
          <div class="group-image">
            <img src="https://images.pexels.com/photos/965989/pexels-photo-965989.jpeg?auto=compress&cs=tinysrgb&w=800" alt="奢华香水">
            <div class="image-overlay"></div>
          </div>
          <div class="group-content">
            <h3 class="group-title">法国进口高端香水礼盒</h3>
            <div class="group-price">
              <div class="real-price">市场价: ¥1280</div>
              <div class="sale-price">抢购价: ¥500</div>
            </div>
            <div class="group-progress-bar">
              <div class="progress-track">
                <div class="progress-fill" style="width: 40%;"></div>
              </div>
              <div class="progress-text">
                <span><span class="joined">4</span> / 10人</span>
                <span>火热进行中</span>
              </div>
            </div>
            <button class="join-group-btn">立即加入拼团</button>
          </div>
        </div>
      </section>

      <!-- 规则说明 -->
      <section class="rules-section">
        <div class="rules-header">
          <div class="rules-title">
            <i class="fas fa-crown"></i>
            <span>拼团规则</span>
          </div>
          <div class="rules-toggle">
            <span class="toggle-text">收起</span>
            <i class="fas fa-chevron-up toggle-icon"></i>
          </div>
        </div>
        <div class="rules-content">
          <div class="rule-item">
            <div class="rule-num">1</div>
            <div class="rule-text">购买500元商品，获得1张拼团券</div>
          </div>
          <div class="rule-item">
            <div class="rule-num">2</div>
            <div class="rule-text">10人参与拼团，消耗1张拼团券</div>
          </div>
          <div class="rule-item">
            <div class="rule-num">3</div>
            <div class="rule-text">仅1人中奖获得商品，失败者获得20元奖励</div>
          </div>
          <div class="rule-item">
            <div class="rule-num">4</div>
            <div class="rule-text">成功获得1颗幸运星，5颗兑换1股股权</div>
          </div>
          <div class="rule-item">
            <div class="rule-num">5</div>
            <div class="rule-text">每股每日分红，单股累计收益≥2500元后退出</div>
          </div>
        </div>
      </section>
    </main>

    <!-- 底部导航 -->
    <nav class="bottom-nav">
      <a href="index.html" class="nav-button">
        <i class="fas fa-home"></i>
        <span>首页</span>
      </a>
      <a href="groupbuy.html" class="nav-button active">
        <i class="fas fa-users"></i>
        <span>拼团</span>
      </a>
      <a href="shares.html" class="nav-button">
        <i class="fas fa-chart-line"></i>
        <span>股权</span>
      </a>
      <a href="profile.html" class="nav-button">
        <i class="fas fa-user"></i>
        <span>我的</span>
      </a>
    </nav>
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      // 规则切换效果
      const rulesToggle = document.querySelector('.rules-toggle');
      const rulesContent = document.querySelector('.rules-content');
      const toggleText = document.querySelector('.toggle-text');
      const toggleIcon = document.querySelector('.toggle-icon');
      
      rulesToggle.addEventListener('click', function() {
        rulesContent.classList.toggle('collapsed');
        
        if (rulesContent.classList.contains('collapsed')) {
          toggleText.textContent = '展开';
          toggleIcon.classList.remove('fa-chevron-up');
          toggleIcon.classList.add('fa-chevron-down');
        } else {
          toggleText.textContent = '收起';
          toggleIcon.classList.remove('fa-chevron-down');
          toggleIcon.classList.add('fa-chevron-up');
        }
      });
      
      // 倒计时功能
      let mainRemainingTime = 6330; // 1小时45分30秒
      const mainTimerElement = document.querySelector('.time-display');
      const ringProgress = document.querySelector('.ring-progress');
      
      function updateMainTimer() {
        const hours = Math.floor(mainRemainingTime / 3600);
        const minutes = Math.floor((mainRemainingTime % 3600) / 60);
        const seconds = mainRemainingTime % 60;
        
        const formattedTime = 
          (hours < 10 ? '0' + hours : hours) + ':' +
          (minutes < 10 ? '0' + minutes : minutes) + ':' +
          (seconds < 10 ? '0' + seconds : seconds);
        
        mainTimerElement.textContent = formattedTime;
        
        // 更新环形进度条
        const totalTime = 7200; // 2小时总时间
        const percentage = (1 - (mainRemainingTime / totalTime)) * 100;
        ringProgress.style.background = `conic-gradient(
          var(--accent-color) 0%,
          var(--accent-color) ${percentage}%,
          transparent ${percentage}%,
          transparent 100%
        )`;
        
        if (mainRemainingTime > 0) {
          mainRemainingTime--;
        } else {
          clearInterval(mainTimerInterval);
          mainTimerElement.parentElement.style.background = 'rgba(255, 0, 0, 0.6)';
          mainTimerElement.textContent = '已结束';
        }
      }
      
      const mainTimerInterval = setInterval(updateMainTimer, 1000);
      
      // 卡片倒计时
      const cardTimers = document.querySelectorAll('.card-countdown span');
      let cardTimes = [1670, 2535]; // 分别是27:50和42:15的秒数
      
      function updateCardTimers() {
        cardTimers.forEach((timer, index) => {
          if (cardTimes[index] > 0) {
            const minutes = Math.floor(cardTimes[index] / 60);
            const seconds = cardTimes[index] % 60;
            
            timer.textContent = `${minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
            cardTimes[index]--;
          } else {
            timer.parentElement.style.background = 'rgba(255, 0, 0, 0.6)';
            timer.textContent = '已结束';
          }
        });
      }
      
      setInterval(updateCardTimers, 1000);
      
      // 拼团按钮点击效果
      const joinButtons = document.querySelectorAll('.join-group-btn');
      
      joinButtons.forEach(button => {
        button.addEventListener('click', function() {
          // 检查拼团券
          const ticketCount = parseInt(document.querySelector('.ticket-info span').textContent);
          
          if (ticketCount > 0) {
            if (confirm('确定要消耗1张拼团券参与抢购吗？')) {
              // 更新拼团券数量
              document.querySelector('.ticket-info span').textContent = (ticketCount - 1) + '张券';
              
              // 模拟加入成功
              const progressFill = this.parentElement.querySelector('.progress-fill');
              const joinedElement = this.parentElement.querySelector('.joined');
              const currentJoined = parseInt(joinedElement.textContent);
              
              joinedElement.textContent = currentJoined + 1;
              progressFill.style.width = ((currentJoined + 1) / 10 * 100) + '%';
              
              // 如果达到10人，模拟抽奖结果
              if (currentJoined + 1 >= 10) {
                setTimeout(() => {
                  const isWinner = Math.random() < 0.1; // 10%的中奖概率
                  
                  if (isWinner) {
                    alert('恭喜您！您获得了本次拼团的商品！\n同时获得1颗幸运星！');
                  } else {
                    alert('很遗憾，您未中奖。\n获得20元奖励金已发放到您的账户');
                  }
                }, 1000);
              } else {
                alert('加入成功！等待更多用户参与拼团');
              }
            }
          } else {
            alert('您的拼团券不足，请购买商品获取拼团券');
          }
        });
      });
      
      // 页面加载动画
      const mainContent = document.querySelector('.content');
      const elements = mainContent.querySelectorAll('section');
      
      elements.forEach((el, index) => {
        el.style.opacity = '0';
        el.style.transform = 'translateY(20px)';
        el.style.transition = `opacity 0.5s ease, transform 0.5s ease`;
        
        setTimeout(() => {
          el.style.opacity = '1';
          el.style.transform = 'translateY(0)';
        }, 100 + (index * 150));
      });
    });
  </script>
</body>
</html> 